//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS EBS service.
///
/// You can use the Amazon Elastic Block Store (Amazon EBS) direct APIs to create Amazon EBS snapshots, write data directly to  		your snapshots, read data on your snapshots, and identify the differences or changes between  		two snapshots. If you’re an independent software vendor (ISV) who offers backup services for  		Amazon EBS, the EBS direct APIs make it more efficient and cost-effective to track incremental changes on  		your Amazon EBS volumes through snapshots. This can be done without having to create new volumes  		from snapshots, and then use Amazon Elastic Compute Cloud (Amazon EC2) instances to compare the differences. You can create incremental snapshots directly from data on-premises into volumes and the  		cloud to use for quick disaster recovery. With the ability to write and read snapshots, you can  		write your on-premises data to an snapshot during a disaster. Then after recovery, you can  		restore it back to Amazon Web Services or on-premises from the snapshot. You no longer need to build and  		maintain complex mechanisms to copy data to and from Amazon EBS. This API reference provides detailed information about the actions, data types, parameters, and errors of the EBS direct APIs. For more information about the elements that make up the EBS direct APIs, and examples of how to use them effectively, see Accessing the Contents of an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide. For more information about the supported Amazon Web Services Regions, endpoints, and service quotas for the EBS direct APIs, see Amazon Elastic Block Store Endpoints and Quotas in the Amazon Web Services General Reference.
public struct EBS: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the EBS client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "EBS",
            serviceIdentifier: "ebs",
            serviceProtocol: .restjson,
            apiVersion: "2019-11-02",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: EBSErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "ca-central-1": "ebs-fips.ca-central-1.amazonaws.com",
            "ca-west-1": "ebs-fips.ca-west-1.amazonaws.com",
            "us-east-1": "ebs-fips.us-east-1.amazonaws.com",
            "us-east-2": "ebs-fips.us-east-2.amazonaws.com",
            "us-west-1": "ebs-fips.us-west-1.amazonaws.com",
            "us-west-2": "ebs-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Seals and completes the snapshot after all of the required blocks of data have been written to it. Completing the snapshot changes the status to completed. You cannot write new blocks to a snapshot after it has been completed.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    @Sendable
    @inlinable
    public func completeSnapshot(_ input: CompleteSnapshotRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CompleteSnapshotResponse {
        try await self.client.execute(
            operation: "CompleteSnapshot", 
            path: "/snapshots/completion/{SnapshotId}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Seals and completes the snapshot after all of the required blocks of data have been written to it. Completing the snapshot changes the status to completed. You cannot write new blocks to a snapshot after it has been completed.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    ///
    /// Parameters:
    ///   - changedBlocksCount: The number of blocks that were written to the snapshot.
    ///   - checksum: An aggregated Base-64 SHA256 checksum based on the checksums of each written block. To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.
    ///   - checksumAggregationMethod: The aggregation method used to generate the checksum. Currently, the only supported aggregation method is LINEAR.
    ///   - checksumAlgorithm: The algorithm used to generate the checksum. Currently, the only supported algorithm is SHA256.
    ///   - snapshotId: The ID of the snapshot.
    ///   - logger: Logger use during operation
    @inlinable
    public func completeSnapshot(
        changedBlocksCount: Int,
        checksum: String? = nil,
        checksumAggregationMethod: ChecksumAggregationMethod? = nil,
        checksumAlgorithm: ChecksumAlgorithm? = nil,
        snapshotId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CompleteSnapshotResponse {
        let input = CompleteSnapshotRequest(
            changedBlocksCount: changedBlocksCount, 
            checksum: checksum, 
            checksumAggregationMethod: checksumAggregationMethod, 
            checksumAlgorithm: checksumAlgorithm, 
            snapshotId: snapshotId
        )
        return try await self.completeSnapshot(input, logger: logger)
    }

    /// Returns the data in a block in an Amazon Elastic Block Store snapshot.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    @Sendable
    @inlinable
    public func getSnapshotBlock(_ input: GetSnapshotBlockRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetSnapshotBlockResponse {
        try await self.client.execute(
            operation: "GetSnapshotBlock", 
            path: "/snapshots/{SnapshotId}/blocks/{BlockIndex}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the data in a block in an Amazon Elastic Block Store snapshot.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    ///
    /// Parameters:
    ///   - blockIndex: The block index of the block in which to read the data. A block index is a logical  index in units of 512 KiB blocks. To identify the block index, divide  the logical offset of the data in the logical volume by the block size (logical offset  of data/524288). The logical offset of the data must be 512  KiB aligned.
    ///   - blockToken: The block token of the block from which to get data. You can obtain the BlockToken  by running the ListChangedBlocks or ListSnapshotBlocks operations.
    ///   - snapshotId: The ID of the snapshot containing the block from which to get data.  If the specified snapshot is encrypted, you must have permission to use the  KMS key that was used to encrypt the snapshot. For more information, see   Using encryption in the Amazon Elastic Compute Cloud User  Guide.
    ///   - logger: Logger use during operation
    @inlinable
    public func getSnapshotBlock(
        blockIndex: Int,
        blockToken: String,
        snapshotId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetSnapshotBlockResponse {
        let input = GetSnapshotBlockRequest(
            blockIndex: blockIndex, 
            blockToken: blockToken, 
            snapshotId: snapshotId
        )
        return try await self.getSnapshotBlock(input, logger: logger)
    }

    /// Returns information about the blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    @Sendable
    @inlinable
    public func listChangedBlocks(_ input: ListChangedBlocksRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListChangedBlocksResponse {
        try await self.client.execute(
            operation: "ListChangedBlocks", 
            path: "/snapshots/{SecondSnapshotId}/changedblocks", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about the blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    ///
    /// Parameters:
    ///   - firstSnapshotId: The ID of the first snapshot to use for the comparison.  The FirstSnapshotID parameter must be specified with a SecondSnapshotId parameter; otherwise, an error occurs.
    ///   - maxResults: The maximum number of blocks to be returned by the request. Even if additional blocks can be retrieved from the snapshot, the request can  return less blocks than MaxResults or an empty  array of blocks. To retrieve the next set of blocks from the snapshot, make another request with  the returned NextToken value. The value of  NextToken is null when there are no  more blocks to return.
    ///   - nextToken: The token to request the next page of results. If you specify NextToken, then  StartingBlockIndex is ignored.
    ///   - secondSnapshotId: The ID of the second snapshot to use for the comparison.  The SecondSnapshotId parameter must be specified with a FirstSnapshotID parameter; otherwise, an error occurs.
    ///   - startingBlockIndex: The block index from which the comparison should start. The list in the response will start from this block index or the next valid block index in the snapshots. If you specify NextToken, then  StartingBlockIndex is ignored.
    ///   - logger: Logger use during operation
    @inlinable
    public func listChangedBlocks(
        firstSnapshotId: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        secondSnapshotId: String,
        startingBlockIndex: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListChangedBlocksResponse {
        let input = ListChangedBlocksRequest(
            firstSnapshotId: firstSnapshotId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            secondSnapshotId: secondSnapshotId, 
            startingBlockIndex: startingBlockIndex
        )
        return try await self.listChangedBlocks(input, logger: logger)
    }

    /// Returns information about the blocks in an Amazon Elastic Block Store snapshot.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    @Sendable
    @inlinable
    public func listSnapshotBlocks(_ input: ListSnapshotBlocksRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListSnapshotBlocksResponse {
        try await self.client.execute(
            operation: "ListSnapshotBlocks", 
            path: "/snapshots/{SnapshotId}/blocks", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about the blocks in an Amazon Elastic Block Store snapshot.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of blocks to be returned by the request. Even if additional blocks can be retrieved from the snapshot, the request can  return less blocks than MaxResults or an empty  array of blocks. To retrieve the next set of blocks from the snapshot, make another request with  the returned NextToken value. The value of  NextToken is null when there are no  more blocks to return.
    ///   - nextToken: The token to request the next page of results. If you specify NextToken, then  StartingBlockIndex is ignored.
    ///   - snapshotId: The ID of the snapshot from which to get block indexes and block tokens.
    ///   - startingBlockIndex: The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot. If you specify NextToken, then  StartingBlockIndex is ignored.
    ///   - logger: Logger use during operation
    @inlinable
    public func listSnapshotBlocks(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        snapshotId: String,
        startingBlockIndex: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListSnapshotBlocksResponse {
        let input = ListSnapshotBlocksRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            snapshotId: snapshotId, 
            startingBlockIndex: startingBlockIndex
        )
        return try await self.listSnapshotBlocks(input, logger: logger)
    }

    /// Writes a block of data to a snapshot. If the specified block contains data, the existing data is overwritten. The target snapshot must be in the pending state. Data written to a snapshot must be aligned with 512-KiB sectors.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    @Sendable
    @inlinable
    public func putSnapshotBlock(_ input: PutSnapshotBlockRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutSnapshotBlockResponse {
        try await self.client.execute(
            operation: "PutSnapshotBlock", 
            path: "/snapshots/{SnapshotId}/blocks/{BlockIndex}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Writes a block of data to a snapshot. If the specified block contains data, the existing data is overwritten. The target snapshot must be in the pending state. Data written to a snapshot must be aligned with 512-KiB sectors.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    ///
    /// Parameters:
    ///   - blockData: The data to write to the block. The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the x-amz-Checksum header. Also, you  	must specify the checksum algorithm using the x-amz-Checksum-Algorithm  	header. The checksum that you provide is part of the Signature Version 4 signing process.  	It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity  	of the data. If the checksums do not correspond, the request fails. For more information,  	see  Using checksums with the EBS direct APIs in the Amazon Elastic Compute Cloud User Guide.
    ///   - blockIndex: The block index of the block in which to write the data. A block index is a logical  	index in units of 512 KiB blocks. To identify the block index, divide  	the logical offset of the data in the logical volume by the block size (logical offset of  	data/524288). The logical offset of the data must be 512  	KiB aligned.
    ///   - checksum: A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.
    ///   - checksumAlgorithm: The algorithm used to generate the checksum. Currently, the only supported algorithm is SHA256.
    ///   - dataLength: The size of the data to write to the block, in bytes. Currently, the only supported size is 524288 bytes. Valid values: 524288
    ///   - progress: The progress of the write process, as a percentage.
    ///   - snapshotId: The ID of the snapshot.  If the specified snapshot is encrypted, you must have permission to use  the KMS key that was used to encrypt the snapshot. For more information,  see  Using encryption in the Amazon Elastic Compute Cloud User  Guide..
    ///   - logger: Logger use during operation
    @inlinable
    public func putSnapshotBlock(
        blockData: AWSHTTPBody,
        blockIndex: Int,
        checksum: String,
        checksumAlgorithm: ChecksumAlgorithm,
        dataLength: Int,
        progress: Int? = nil,
        snapshotId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutSnapshotBlockResponse {
        let input = PutSnapshotBlockRequest(
            blockData: blockData, 
            blockIndex: blockIndex, 
            checksum: checksum, 
            checksumAlgorithm: checksumAlgorithm, 
            dataLength: dataLength, 
            progress: progress, 
            snapshotId: snapshotId
        )
        return try await self.putSnapshotBlock(input, logger: logger)
    }

    /// Creates a new Amazon EBS snapshot. The new snapshot enters the pending state after the request completes.  After creating the snapshot, use  PutSnapshotBlock to write blocks of data to the snapshot.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    @Sendable
    @inlinable
    public func startSnapshot(_ input: StartSnapshotRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartSnapshotResponse {
        try await self.client.execute(
            operation: "StartSnapshot", 
            path: "/snapshots", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new Amazon EBS snapshot. The new snapshot enters the pending state after the request completes.  After creating the snapshot, use  PutSnapshotBlock to write blocks of data to the snapshot.  You should always retry requests that receive server (5xx)  error responses, and ThrottlingException and RequestThrottledException  client error responses. For more information see Error retries in the  Amazon Elastic Compute Cloud User Guide.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent  request, if the original request completes successfully. The subsequent retries with the same  client token return the result from the original successful request and they have no additional  effect. If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK. For more information, see  		Idempotency for StartSnapshot API in the Amazon Elastic Compute Cloud User Guide.
    ///   - description: A description for the snapshot.
    ///   - encrypted: Indicates whether to encrypt the snapshot. You can't specify Encrypted and  ParentSnapshotId in the same request. If you specify both parameters, the  request fails with ValidationException. The encryption status of the snapshot depends on the values that you specify for  Encrypted, KmsKeyArn,  and ParentSnapshotId, and whether your Amazon Web Services account  is enabled for  encryption by default. For more information, see  Using encryption in the Amazon Elastic Compute Cloud User Guide.  To create an encrypted snapshot, you must have permission to use the KMS key. For  more information, see  Permissions to use Key Management Service keys in the Amazon Elastic Compute Cloud User  Guide.
    ///   - kmsKeyArn: The Amazon Resource Name (ARN) of the Key Management Service (KMS) key to be used to encrypt the snapshot. The encryption status of the snapshot depends on the values that you specify for  Encrypted, KmsKeyArn,  and ParentSnapshotId, and whether your Amazon Web Services account  is enabled for  encryption by default. For more information, see  Using encryption in the Amazon Elastic Compute Cloud User Guide.  To create an encrypted snapshot, you must have permission to use the KMS key. For  more information, see  Permissions to use Key Management Service keys in the Amazon Elastic Compute Cloud User  Guide.
    ///   - parentSnapshotId: The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter. You can't specify ParentSnapshotId and  Encrypted in the same request. If you specify both  parameters, the request fails with ValidationException. The encryption status of the snapshot depends on the values that you specify for  Encrypted, KmsKeyArn,  and ParentSnapshotId, and whether your Amazon Web Services account  is enabled for  encryption by default. For more information, see  Using encryption in the Amazon Elastic Compute Cloud User Guide.  If you specify an encrypted parent snapshot, you must have permission to use the  KMS key that was used to encrypt the parent snapshot. For more information, see   Permissions to use Key Management Service keys in the Amazon Elastic Compute Cloud User  Guide.
    ///   - tags: The tags to apply to the snapshot.
    ///   - timeout: The amount of time (in minutes) after which the snapshot is automatically cancelled if:   No blocks are written to the snapshot.   The snapshot is not completed after writing the last block of data.   If no value is specified, the timeout defaults to 60 minutes.
    ///   - volumeSize: The size of the volume, in GiB. The maximum size is 65536 GiB (64 TiB).
    ///   - logger: Logger use during operation
    @inlinable
    public func startSnapshot(
        clientToken: String? = StartSnapshotRequest.idempotencyToken(),
        description: String? = nil,
        encrypted: Bool? = nil,
        kmsKeyArn: String? = nil,
        parentSnapshotId: String? = nil,
        tags: [Tag]? = nil,
        timeout: Int? = nil,
        volumeSize: Int64,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartSnapshotResponse {
        let input = StartSnapshotRequest(
            clientToken: clientToken, 
            description: description, 
            encrypted: encrypted, 
            kmsKeyArn: kmsKeyArn, 
            parentSnapshotId: parentSnapshotId, 
            tags: tags, 
            timeout: timeout, 
            volumeSize: volumeSize
        )
        return try await self.startSnapshot(input, logger: logger)
    }
}

extension EBS {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: EBS, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension EBS {
    /// Return PaginatorSequence for operation ``listChangedBlocks(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listChangedBlocksPaginator(
        _ input: ListChangedBlocksRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListChangedBlocksRequest, ListChangedBlocksResponse> {
        return .init(
            input: input,
            command: self.listChangedBlocks,
            inputKey: \ListChangedBlocksRequest.nextToken,
            outputKey: \ListChangedBlocksResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listChangedBlocks(_:logger:)``.
    ///
    /// - Parameters:
    ///   - firstSnapshotId: The ID of the first snapshot to use for the comparison.  The FirstSnapshotID parameter must be specified with a SecondSnapshotId parameter; otherwise, an error occurs.
    ///   - maxResults: The maximum number of blocks to be returned by the request. Even if additional blocks can be retrieved from the snapshot, the request can  return less blocks than MaxResults or an empty  array of blocks. To retrieve the next set of blocks from the snapshot, make another request with  the returned NextToken value. The value of  NextToken is null when there are no  more blocks to return.
    ///   - secondSnapshotId: The ID of the second snapshot to use for the comparison.  The SecondSnapshotId parameter must be specified with a FirstSnapshotID parameter; otherwise, an error occurs.
    ///   - startingBlockIndex: The block index from which the comparison should start. The list in the response will start from this block index or the next valid block index in the snapshots. If you specify NextToken, then  StartingBlockIndex is ignored.
    ///   - logger: Logger used for logging
    @inlinable
    public func listChangedBlocksPaginator(
        firstSnapshotId: String? = nil,
        maxResults: Int? = nil,
        secondSnapshotId: String,
        startingBlockIndex: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListChangedBlocksRequest, ListChangedBlocksResponse> {
        let input = ListChangedBlocksRequest(
            firstSnapshotId: firstSnapshotId, 
            maxResults: maxResults, 
            secondSnapshotId: secondSnapshotId, 
            startingBlockIndex: startingBlockIndex
        )
        return self.listChangedBlocksPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listSnapshotBlocks(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listSnapshotBlocksPaginator(
        _ input: ListSnapshotBlocksRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListSnapshotBlocksRequest, ListSnapshotBlocksResponse> {
        return .init(
            input: input,
            command: self.listSnapshotBlocks,
            inputKey: \ListSnapshotBlocksRequest.nextToken,
            outputKey: \ListSnapshotBlocksResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listSnapshotBlocks(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of blocks to be returned by the request. Even if additional blocks can be retrieved from the snapshot, the request can  return less blocks than MaxResults or an empty  array of blocks. To retrieve the next set of blocks from the snapshot, make another request with  the returned NextToken value. The value of  NextToken is null when there are no  more blocks to return.
    ///   - snapshotId: The ID of the snapshot from which to get block indexes and block tokens.
    ///   - startingBlockIndex: The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot. If you specify NextToken, then  StartingBlockIndex is ignored.
    ///   - logger: Logger used for logging
    @inlinable
    public func listSnapshotBlocksPaginator(
        maxResults: Int? = nil,
        snapshotId: String,
        startingBlockIndex: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListSnapshotBlocksRequest, ListSnapshotBlocksResponse> {
        let input = ListSnapshotBlocksRequest(
            maxResults: maxResults, 
            snapshotId: snapshotId, 
            startingBlockIndex: startingBlockIndex
        )
        return self.listSnapshotBlocksPaginator(input, logger: logger)
    }
}

extension EBS.ListChangedBlocksRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> EBS.ListChangedBlocksRequest {
        return .init(
            firstSnapshotId: self.firstSnapshotId,
            maxResults: self.maxResults,
            nextToken: token,
            secondSnapshotId: self.secondSnapshotId,
            startingBlockIndex: self.startingBlockIndex
        )
    }
}

extension EBS.ListSnapshotBlocksRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> EBS.ListSnapshotBlocksRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            snapshotId: self.snapshotId,
            startingBlockIndex: self.startingBlockIndex
        )
    }
}
